package com.carpedil.smvc.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.carpedil.smvc.po.User;
import org.springframework.stereotype.Service;

import java.util.List;

/** @author Administrator */
@Service
public interface UserService {
  /**
   * insertUser
   *
   * @param user user
   * @return i
   */
  boolean insertUser(User user);

  /**
   * deleteUserById
   *
   * @param id id
   * @return i
   */
  boolean deleteUserById(Integer id);
  /**
   * updateUser
   *
   * @param user user
   * @return i
   */
  boolean updateUser(User user);

  /**
   * getUsersByCondition
   *
   * @param id id
   * @param name name
   * @param nickName nickName
   * @return Users
   */
  List<User> getUsersByCondition(Integer id, String name, String nickName);

  /**
   * getUsersByPage
   *
   * @param pageNo pageNo
   * @param pageSize pageSize
   * @return IPage<User>
   */
  IPage<User> getUsersByPage(Integer pageNo, Integer pageSize);

  /**
   * getUsersByPageLink
   *
   * @param pageNo pageNo
   * @param pageSize pageSize
   * @param roleId roleId
   * @return IPage<User>
   */
  IPage<User> getUsersByPageParam(Integer pageNo, Integer pageSize, Integer roleId);

  /**
   * findUserById
   *
   * @param id id
   * @return user
   */
  User findUserById(Integer id);

  /**
   * login
   *
   * @param user user
   * @return boolean t/f
   */
  User login(User user);
  /**
   * login2
   *
   * @param user user
   * @return boolean t/f
   */
  User login2(User user);

  List<User> getAllUser();

  /**
   * findUserByRoleName()
   *
   * @param roleName roleName
   * @return List<User>
   */
  List<User> findUserByRoleName(String roleName);
}
